Introduction
A new es_extended version might be incompatible with some "old" scripts
esx:getSharedObject deprecated
- If you get error in F8 that
getSharedObject
is deprecated and you should replace it, follow these steps to fix it. You can choose between these options
If you will follow these steps you will be fine
- Add
'@es_extended/imports.lua'
to fxmanifest.lua of your script into client_scripts/sever_scripts/shared_scripts variable
- Before
- After
fx_version 'cerulean'
game 'gta5'
version '1.0.0'
lua54 'yes'
shared_scripts { '@es_extended/locale.lua', 'locales/*.lua', 'config.lua' }
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
client_scripts { 'client/*.lua' }
fx_version 'cerulean'
game 'gta5'
version '1.0.0'
lua54 'yes'
shared_scripts { '@es_extended/imports.lua', '@es_extended/locale.lua', 'locales/*.lua', 'config.lua' }
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
client_scripts { 'client/*.lua' }
- Replace
getSharedObject
for exportes_extended['es_extended']:getSharedObject()
(works for both client & server side)
- Before
- After
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
ESX = exports['es_extended']:getSharedObject()
- (NOT RECOMMENDED, but works also) In es_extended/server/common.lua & es_extended/client/common.lua replace esx:getSharedEvent as described bellow
- Before
- After
AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
AddEventHandler('esx:getSharedObject', function(cb)
cb(ESX)
end)